class HistoryBluetoothDevice {
  String name;
  String type;
  String address;
  String otaAddress;
  String chipType;
  String advVersion;
  String vid;
  String uid;
  String pid;
  String leftDevLatitude;
  String leftDevLongitude;
  String leftDevUpdateTime;
  String rightDevLatitude;
  String rightDevLongitude;
  String rightDevUpdateTime;
  int connectStatus=0;

  HistoryBluetoothDevice({
    this.name = '',
    this.type = '',
    this.address = '',
    this.otaAddress = '',
    this.chipType = '',
    this.advVersion = '',
    this.vid = '',
    this.uid = '',
    this.pid = '',
    this.leftDevLatitude = '',
    this.leftDevLongitude = '',
    this.leftDevUpdateTime = '',
    this.rightDevLatitude = '',
    this.rightDevLongitude = '',
    this.rightDevUpdateTime = '',
  });

  factory HistoryBluetoothDevice.fromJson(Map<String, dynamic> json) {
    return HistoryBluetoothDevice(
      name: json['name']?.toString() ?? '',
      type: json['type']?.toString() ?? '',
      address: json['address']?.toString() ?? '',
      otaAddress: json['otaAddress']?.toString() ?? '',
      chipType: json['chipType']?.toString() ?? '',
      advVersion: json['advVersion']?.toString() ?? '',
      vid: json['vid']?.toString() ?? '',
      uid: json['uid']?.toString() ?? '',
      pid: json['pid']?.toString() ?? '',
      leftDevLatitude: json['leftDevLatitude']?.toString() ?? '',
      leftDevLongitude: json['leftDevLongitude']?.toString() ?? '',
      leftDevUpdateTime: json['leftDevUpdateTime']?.toString() ?? '',
      rightDevLatitude: json['rightDevLatitude']?.toString() ?? '',
      rightDevLongitude: json['rightDevLongitude']?.toString() ?? '',
      rightDevUpdateTime: json['rightDevUpdateTime']?.toString() ?? '',
    );
  }

  Map<String, String> toJson() {
    return {
      'name': name,
      'type': type,
      'address': address,
      'otaAddress': otaAddress,
      'chipType': chipType,
      'advVersion': advVersion,
      'vid': vid,
      'uid': uid,
      'pid': pid,
      'leftDevLatitude': leftDevLatitude,
      'leftDevLongitude': leftDevLongitude,
      'leftDevUpdateTime': leftDevUpdateTime,
      'rightDevLatitude': rightDevLatitude,
      'rightDevLongitude': rightDevLongitude,
      'rightDevUpdateTime': rightDevUpdateTime,
    };
  }

  @override
  String toString() {
    return 'HistoryBluetoothDevice{name: $name, type: $type, address: $address, otaAddress: $otaAddress, chipType: $chipType, advVersion: $advVersion, vid: $vid, uid: $uid, pid: $pid, leftDevLatitude: $leftDevLatitude, leftDevLongitude: $leftDevLongitude, leftDevUpdateTime: $leftDevUpdateTime, rightDevLatitude: $rightDevLatitude, rightDevLongitude: $rightDevLongitude, rightDevUpdateTime: $rightDevUpdateTime, connectStatus: $connectStatus}';
  }
}
